import { deleteTpl, viewTplFile } from '@/api/tpl.js';
import { getCurrentInstance } from 'vue';

export const useOperateMode = () => {
  const instance = getCurrentInstance();
  const {$message} = instance.appContext.config.globalProperties;
  // 删除模版
  async function deleteHandle(item) {
    const returnData = await deleteTpl({tplCode: item.tplCode});
    console.log(returnData);
    if (returnData?.code === 200) {
      $message.success(returnData?.msg);
    } else {
      $message.error(returnData?.msg);
    }
  }
  return {
    deleteHandle,
  }
}
